﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Facebook;

namespace FacebookApp
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            

                ////var accessToken = "your access token here";
                //var client = new FacebookClient("CAAGJnN3cKNcBACKwH7g87hrakwVH5huTZBBoVCUsbsiF45pZAk92A23AbOdsJD1DbUhiPWjAz9OI93rWoPggeipQT5jbRwpqOTfTueXWAQUMzXtZCAZC9IZBZCGD8VxZAGTPg67dW6uXhZCGgAXNL1lwnGJ82YPK6tNSw74efgyBhSbwdguQBMiWtnBKDN0Mb5ckJIUmmxAgVwZDZD");
                //client.AppId = "1647257262205561";
                //client.AppSecret = "3c0a96735a634957591d5e2413314744";
                //client.IsSecureConnection = false;
                //dynamic me = client.Get("me/friends");
                //Response.Write(me);


        }

        protected void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                txtOutput.Text = "";
                var client = new FacebookClient(txtToken.Text);
                client.AppId = "1647257262205561";
                client.AppSecret = "3c0a96735a634957591d5e2413314744";
                client.IsSecureConnection = false;
                dynamic me = client.Get(txtQuery.Text);
                txtOutput.Text = Convert.ToString(me);
            }
            catch (Exception ex)
            {
                txtOutput.Text = ex.ToString();
            }
        }



    }
}
